<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../lib/vue.js"></script>
</head>
<body>

<div id="app1">
    <input type="button" value="按钮" @click="changeColor"/>
    <div style="width:100px; height:100px; background-color: red;" v-show="a"></div>
</div>

<script>
    var app1 = new Vue({
        el: '#app1',
        data: {
            a: false
        },
        methods: {
            changeColor: function () {
                if(this.a){
                    this.a = false;
                }else{
                    this.a = true;
                }
            }
        }
    })
</script>
</body>
</html>